// 分公司-访问次数
GET abax_entrance_log/_search
{
    "size": 0,
    "query": {
        "bool": {
            "must": [
                {
                    "range": {
                        "access_time": {
                            "from": 1635177600000,
                            "to": 1635263940000,
                            "include_lower": true,
                            "include_upper": true,
                            "boost": 1.0
                        }
                    }
                },
                {
                    "bool": {
                        "should": [
                            {
                                "term": {
                                    "company_code": {
                                        "value": "10001001",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "company_code": {
                                        "value": "10001005",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "company_code": {
                                        "value": "10001010",
                                        "boost": 1.0
                                    }
                                }
                            }
                        ],
                        "adjust_pure_negative": true,
                        "boost": 1.0
                    }
                },
                {
                    "bool": {
                        "should": [
                            {
                                "term": {
                                    "store_type": {
                                        "value": "00",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "store_type": {
                                        "value": "01",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "store_type": {
                                        "value": "02",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "store_type": {
                                        "value": "03",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "store_type": {
                                        "value": "04",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "store_type": {
                                        "value": "05",
                                        "boost": 1.0
                                    }
                                }
                            }
                        ],
                        "adjust_pure_negative": true,
                        "boost": 1.0
                    }
                },
                {
                    "bool": {
                        "should": [
                            {
                                "term": {
                                    "post_code": {
                                        "value": "10001239",
                                        "boost": 1.0
                                    }
                                }
                            },
                            {
                                "term": {
                                    "post_code": {
                                        "value": "10001240",
                                        "boost": 1.0
                                    }
                                }
                            }
                        ],
                        "adjust_pure_negative": true,
                        "boost": 1.0
                    }
                }
            ],
            "filter": [
                {
                    "term": {
                        "app_id": {
                            "value": "fire-drm",
                            "boost": 1.0
                        }
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1.0
        }
    },
    "aggregations": {
        "group_by_company_code": {
            "terms": {
                "field": "company_code",
                "size": 3,
                "shard_size": 13,
                "min_doc_count": 1,
                "shard_min_doc_count": 0,
                "show_term_doc_count_error": false,
                "order": [
                    {
                        "_count": "desc"
                    },
                    {
                        "_key": "asc"
                    }
                ]
            }
        }
    }
}